<!--
Date: 2025-08-13
Copyright (c) 2025 CAX Conversion Project
-->
<template>
  <el-dialog v-model="dialogVisible" title="查看报告" width="800" :before-close="closeDialog">
    <el-tabs v-model="activeName">
      <el-tab-pane label="点云校验" name="first">
        <el-descriptions :column="1" border>
          <el-descriptions-item label="转换模型多余的点">{{ datas.excess }}</el-descriptions-item>
          <el-descriptions-item label="转换模型缺失的点">{{ datas.missed }}</el-descriptions-item>
          <!-- <el-descriptions-item label="转换模型详情">{{ datas.excessRatio }}</el-descriptions-item>
          <el-descriptions-item label="原模型详情">{{ datas.missed }}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="转换模型地址"> {{ datas.missedRatio }}</el-descriptions-item>
          <el-descriptions-item label="原模型地址">{{ datas.score }}</el-descriptions-item> -->
          <el-descriptions-item label="转换模型点云总数">{{ datas.targetTotalSize }}</el-descriptions-item>
          <el-descriptions-item label="原模型点云总数">{{ datas.sourceTotalSize }}</el-descriptions-item>
          <el-descriptions-item label="点云是否相互覆盖">{{ datas.converged === '1' ? '覆盖' : '未覆盖' }}</el-descriptions-item>
          <el-descriptions-item label="两模型配准"> {{ datas.score }}</el-descriptions-item>
        </el-descriptions>
      </el-tab-pane>
      <el-tab-pane label="几何校验" name="second">
        <el-descriptions :column="1" border>
          <el-descriptions-item label="转换模型表面积">{{ datas2.destSurfaceArea }}</el-descriptions-item>
          <el-descriptions-item label="原模型表面积">{{ datas2.srcSurfaceArea }}</el-descriptions-item>
          <el-descriptions-item label="转换模型顶点数"> {{ datas2.destVertexCount }}</el-descriptions-item>
          <el-descriptions-item label="原模型顶点数">{{ datas2.srcVertexCount }}</el-descriptions-item>
          <el-descriptions-item label="转换模型体积">{{ datas2.destVolumn }}</el-descriptions-item>
          <el-descriptions-item label="原模型体积">{{ datas2.srcVolumn }}</el-descriptions-item>
          <el-descriptions-item label="顶点是否相互覆盖">{{ datas2.converged === '1' ? '覆盖' : '未覆盖' }}</el-descriptions-item>
          <el-descriptions-item label="两模型配准"> {{ datas2.score }}</el-descriptions-item>
        </el-descriptions>
      </el-tab-pane>
    </el-tabs>
    <template #footer>
      <div class="dialog-footer text-center">
        <el-button type="primary" @click="closeDialog">关闭</el-button>
      </div>
    </template>
  </el-dialog>
</template>

<script setup name="OperationLogDialog" lang="ts">
import { qualityChecker, geometricCheck } from '@/api/caxDataConversionMajorComponent/conversionRecordManagement/index';

const dialogVisible = ref(false);
const datas = ref({
  samplingPrecision: '',
  excess: '',
  excessRatio: '',
  missed: '',
  missedRatio: '',
  score: '',
  converged: '',
  sourceTotalSize: '',
  targetTotalSize: '',
  createBy: '',
  createTime: ''
});
const datas2 = ref({
  destSurfaceArea: '',
  destVertexCount: '',
  destVolumn: '',
  srcSurfaceArea: '',
  srcVertexCount: '',
  srcVolumn: '',
  converged: '',
  score: ''
});
const activeName = ref('first');
const openDialog = async (id) => {
  const res = await qualityChecker(id);
  datas.value = res.data ? res.data : {};
  const res2 = await geometricCheck(id);
  datas2.value = res2.data ? res2.data : {};
  dialogVisible.value = true;
};
const closeDialog = () => {
  dialogVisible.value = false;
};
defineExpose({
  openDialog,
  closeDialog
});
</script>
<style lang="scss" scoped></style>
